package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 损益单
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_increase_decrease")
@ApiModel(value = "IncreaseDecrease", description = "损益单")
public class IncreaseDecreaseEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 损益单号
     */
    @ApiModelProperty(value = "损益单号")
    @NotEmpty(message = "损益单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "损益单号长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 库存
     */
    @ApiModelProperty(value = "库存")
    @TableField(value = "stock_id")
    private Long stockId;
    /**
     * 损益数量
     */
    @ApiModelProperty(value = "损益数量")
    @TableField(value = "id_num")
    private Integer idNum;
    /**
     * 损益金额
     */
    @ApiModelProperty(value = "损益金额")
    @TableField(value = "id_money")
    private java.math.BigDecimal idMoney;
    /**
     * 损益来源 盘点:PD、上架:SJ、拣货:JH
     */
    @ApiModelProperty(value = "损益来源 盘点:PD、上架:SJ、拣货:JH")
    @Length(max = 10, message = "损益来源 盘点:PD、上架:SJ、拣货:JH长度不能超过10")
    @TableField(value = "id_source")
    private String idSource;
    /**
     * 任务id
     */
    @ApiModelProperty(value = "任务id")
    @NotNull(message = "任务id不能为空", groups = {Save.class})
    @TableField(value = "task_id")
    private Long taskId;
    /**
     * 任务单号
     */
    @ApiModelProperty(value = "任务单号")
    @NotEmpty(message = "任务单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "任务单号长度不能超过50")
    @TableField(value = "task_code")
    private String taskCode;
    /**
     * 损益单状态 1.新建、2已调整
     */
    @ApiModelProperty(value = "损益单状态 1.新建、2已调整")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
